#include "Interactor.h"
#include <SECore/EventDispatcher.h>
#include <SECore/Events/MouseEvent.h>
#include <SECore/Events/KeyBoardEvent.h>

namespace SEngine
{
    void Interactor::OnEvent(EventPtr event)
    {
        EventDispatcher dispatcher(event);
        dispatcher.Dispatcher<MousePressEvent>(std::bind(&Interactor::OnMousePressEvent, this, std::placeholders::_1));
        dispatcher.Dispatcher<MouseReleaseEvent>(std::bind(&Interactor::OnMouseReleaseEvent, this, std::placeholders::_1));
        dispatcher.Dispatcher<MouseMoveEvent>(std::bind(&Interactor::OnMouseMoveEvent, this, std::placeholders::_1));
        dispatcher.Dispatcher<MouseWheelEvent>(std::bind(&Interactor::OnMouseWheelEvent, this, std::placeholders::_1));
        dispatcher.Dispatcher<KeyPressEvent>(std::bind(&Interactor::OnKeyPressEvent, this, std::placeholders::_1));
        dispatcher.Dispatcher<KeyReleaseEvent>(std::bind(&Interactor::OnKeyReleaseEvent, this, std::placeholders::_1));
    }
    
} // namespace SEngine

